
#ifndef Velyn_Spherical_h
#define Velyn_Spherical_h

#include "IDisplacement.h"

namespace Velyn {
    
    namespace Displacements {
        
        /* 
         * Sets the object to a sphere
         */

        class Spherical : public IDisplacement {
            
        public:
            
            Spherical() {}
            
            ~Spherical() {}
            
            /*
             * Displace to a sphere.
             */
            
            virtual int displace(TriangleMesh* mesh) {
                
                // get the vertices
                Vertex* vertices = mesh->getVertices();
                
                // for each vertex in the mesh
                for(int vertex = 0; vertex < mesh->numberVertices(); vertex++) {
                    
                    // normalize the vertex
                    vertices[vertex].normalize();

                }
                
                return 1;
                
            }	
            
        };
        
    }
    
}

#endif
